/*
 * @Author: mikey.zhaoyd
 * @Date: 2019-01-24 09:12:41
 * @Last Modified by:   mikey.zhaoyd
 * @Last Modified time: 2019-01-24 09:12:41
 */

#ifndef _GIZWITS_PRODUCT_H
#define _GIZWITS_PRODUCT_H

#ifdef __cplusplus
extern "C"
{
#endif

#include "protocol.h"
#include <stdint.h>
#include <stm32f1xx.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#include "ringBuffer.h"
   
//#define MAX_PACKAGE_LEN    (sizeof(devStatus_t)+sizeof(dataPointFlags_t)+20)                 ///< Data buffer maximum length                                   ///< Data buffer maximum length
#define MAX_PACKAGE_LEN 128  ///< Data buffer maximum length                                   ///< Data buffer maximum length

#define RB_MAX_LEN (MAX_PACKAGE_LEN * 2)  ///< Maximum length of ring buffer
#define RB_PM_MAX_LAN 32 * 2              //PM25传感器数据长度为32

extern uint32_t gizGetTimerCount(void);
void    ringBufferInit(void);
int32_t gizPutData(rb_t* pRb, uint8_t* buf, uint32_t len);
void userInit(void);
void userHandle(void);




    

#ifdef __cplusplus
}
#endif

#endif
